var t = 3; 
var pagepath="";
var idForBtn="";
var t_messageCodeTime = 60; 
var t_rulesTime = 10; 
//显示倒数秒数
function showTime(page){  
	if(page!=undefined){
		pagepath = page;
	}
    t -= 1;  
    document.getElementById("mes").innerHTML = t;  
    if(t==0){  
    	window.location.href ='../mobile/'+pagepath+'';  
    }  
    //每秒执行一次showTime
    setTimeout("showTime()",1000);  
}  

//短信验证码倒计时
function messageCodeTime(btnId){
	if(t_messageCodeTime<=0){
		t_messageCodeTime = 60;
	}
	if(btnId!=undefined){
		idForBtn = btnId;
	}
	t_messageCodeTime -= 1;  
    document.getElementById(idForBtn).value=t_messageCodeTime+"秒后再获";
    $("#"+idForBtn).attr("disabled", true); 
    if(t_messageCodeTime==0){  
    	document.getElementById(idForBtn).value="获取验证码";
    	 $("#"+idForBtn).attr("disabled", false); 
    	 return;
    }  
    //每秒执行一次messageCodeTime
    setTimeout("messageCodeTime()",1000);  
}  

//阅读会员规则倒计时
function rulesTime(btnId){
	if(t_rulesTime<=0){
		t_rulesTime = 10;
	}
	if(btnId!=undefined){
		idForBtn = btnId;
	}
	t_rulesTime -= 1;  
    document.getElementById(idForBtn).value=t_rulesTime+"秒";
    $("#"+idForBtn).attr("disabled", true); 
    $("#"+idForBtn).css('background','#777');
    if(t_rulesTime==0){  
    	document.getElementById(idForBtn).value="确认";
    	 $("#"+idForBtn).attr("disabled", false); 
    	    $("#"+idForBtn).css('background','#f00015');
    	 return;
    }  
    //每秒执行一次messageCodeTime
    setTimeout("rulesTime()",1000);  
}  